package com.itheima.zuoye.zy1;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class Test   {
    public static void main(String[] args) {


        MyRunnable r=new MyRunnable();
        ExecutorService pool=new ThreadPoolExecutor(
                2,
                5,
                1000,
               TimeUnit.SECONDS,
                new ArrayBlockingQueue<>(3),
                new ThreadPoolExecutor.DiscardPolicy()
        );

        pool.execute(r);
        pool.execute(r);


//        new Thread( r,"张三").start();
//        new Thread( r,"李四").start();
    }
}
